

//--------------------
// MakeTableOfRandomProblems
//--------------------
function MakeTableOfRandomProblems($userid)
{
	$nrow = 10;
	$ncol = 10;
	$Nprob = $nrow*$ncol;
	
	GetQuestionStatusForUser($userid, &$allowed_questions, &$not_allowed_questions)
		
	?>
	<center><h1>Test has started!</h1></center>
	<center>There are <?=$Nprob?> problems</center>

	<center>
	<form method='POST' action='check_answers.php' autocomplete='off'>
	<input type='hidden' name='nrow' value='<?=$nrow?>'/>
	<input type='hidden' name='ncol' value='<?=$ncol?>'/>
	<input type='hidden' name='start_time' value='<?=time()?>'/>

	<table cellpadding='20'>
	<?php
	
	for($j=0; $j<$nrow; $j++){
		print "<tr>\n";
		for($i=0; $i<$ncol; $i++){
			print "	<td align='right'>\n";
			$num1 = rand(0,12);
			$num2 = rand(0,12);
			show_problem($num1, "times", $num2);
			
			if(1){
				$prob = $i+$j*$ncol+1;
				print "<input type='text' size='5' name='answer${prob}'>\n";
				print "<input type='hidden' name='q${prob}num1' value='${num1}'/>\n";
				print "<input type='hidden' name='q${prob}num2' value='${num2}'/>\n";
			}else{
				show_number($num1*$num2);
			}
			print "	</td>\n";
		}
		print "</tr>\n";
	}
	
	?>
	<tr><td colspan="<?=$ncol?>"><center><input type="submit" value="Submit All Answers"></center></td></tr>
	</table>
	</form>
	
	<p><form method="POST" action="index.php"><input type="submit" value="Cancel"></form></p>
	</center>

	
	<?php
}
